@extends('layout')

@section('content')
<?php 
    $uid = null;
    if ($user != null) {
        $uid = $user->getKey();
    }
?>
@foreach($teams as $team)
    <?php $id = $team->getKey(); 
    if ($user != null && $team->isOwner($uid)) { ?>
        <p>
        <a href="{{TheApp::root()}}team/{{ $id }}">
                {{ $team->name }}, U{{ $team->age}}, {{ $team->gender }}, {{ $team->class}}</a>
         &nbsp; &nbsp; MY TEAM
        </p>
    <?php } ?>
@endforeach
@if ($user != null)
<hr>
@endif
@foreach($teams as $team)
    <?php $id = $team->getKey(); 
    if ($user == null || $user != null && !$team->isOwner($uid)) {
        ?>
        <p>
        <a href="{{TheApp::root()}}team/{{ $id }}">
            {{ $team->name }}, U{{ $team->age}}, {{ $team->gender }}, {{ $team->class}}</a>
        </p>
    <?php } ?>
@endforeach
@stop
